package code;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Sum_InArray_day10_shenxinfu {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        String[] numbers = input.split(",");
        List<Integer> list = new ArrayList<Integer>();
       for(String number : numbers){
           list.add(Integer.parseInt(number));
       }

        int sum = 0;
        for(int i=0;i<list.size();i++){
            for(int j=i;j<list.size();j++){
                if((j-i)%2==0){
                  for(int k=i;k<=j;k++){
                      sum+=list.get(k);
                  }
                }
            }
        }
        System.out.println(sum);
    }

}
